<template>
	<view style="padding-bottom: 130rpx;">

		<view class="boxContrainer">
			<view class="titlBox">
				<text class="title">违章押金付款情况</text>
			</view>
			<view class="contentBox">
				<view class="textItem">
					<text>应付违章押金</text>
					<text style="color: #333;">{{detailInfo.depositPayable||0}}元</text>
				</view>
				<view class="textItem">
					<text>预授权已付</text>
					<text style="color: #333;">{{detailInfo.preLicensingAmount||0}}元</text>
				</view>
				<view class="textItem">
					<text>其他方式已付</text>
					<text style="color: #333;">{{detailInfo.otherAmount||0}}元</text>
				</view>
				<view class="textItem">
					<text>违章费用抵扣</text>
					<text style="color: #333;">{{detailInfo.vehicleDamageExpense||'0元'}}</text>
				</view>
				<view class="textItem">
					<text>违章押金结余</text>
					<text style="color: #333;">{{detailInfo.surplus||'0元'}}</text>
				</view>
				
				<view style="color: #FF6600;font-size: 28rpx;" v-if="detailInfo.surplus">
					{{detailInfo.surplus}},将有财务人员退款
				</view>
				
			</view>
		</view>
		
		<button type="info" class="sub-btn" @click="confimSettlement">确认结算</button>
	</view>
</template>

<script>
	import * as orderApi from '@/api/order-api.js';
	export default {
		data() {
			return {
                detailInfo:{},
				orderNo: ''
			}
		},
		methods: {
		  getIllegalDetail() {
			 orderApi.illegalDetail(this.orderNo).then(res=>{
				 this.detailInfo = res.data;
			 })  
		  },
		  // 确认结算
		  confimSettlement() {
			  orderApi.IllegalDepositRefund(this.orderNo).then(res=>{
				  uni.$emit('refreshOrder');
				  this.$u.toast('违章结算成功');
				  uni.navigateBack({
				  	animationDuration: 300
				  });
			  })
		  }
		  
		},
		onLoad: function(option) {
			const item = JSON.parse(decodeURIComponent(option.item));
			this.orderNo = item.orderNo;
			this.getIllegalDetail()
		},
	}
</script>

<style lang="scss" scoped>
	
</style>
